home *** CD-ROM | disk | FTP | other *** search
- /* #! sys:rexxc/rx */
- /* $VER: gast.cgi 1.0 (28.08.00) */
- /* Gästebuch-Script für clarissahttpd */
- /* © Martin Kayser */
-
- /********************** Konfiguration *************/
- hintergrundbild='' /** relativer HTML-Pfad zum Script **/
- hgfarbe='#5c3317' /** in typischer HTML-Notierung **/
- txtfarbe='#ffbb00' /** in typischer HTML-Notierung **/
- linkfarbe='#dddd00' /** Farbe für Links **/
- vlinkfarbe='#aaaa00' /** Farbe für bereits besuchte Links **/
- datafile='clarissa-httpd:html/gast/gast.data' /** CLI/Shell-Pfad der Datei in welche
- ** die GB-Einträge geschrieben werden
- ** sollen. Die Datei muß!!! existieren
- ** kann allerdings 0 Byte groß sein!**/
- hr='<IMG SRC=/gast/ruler.gif WIDTH=554 HEIGHT=5 ALT="---------------"><BR>'
- /** HTML-Befehl für eine Trennlinie **/
- owner='Clarissa-HTTPd' /** Hier wird eingetragen, wem das Gästebuch gehört! ;-) **/
- gbread='/gast/index.shtml' /** HTML-Pfad der Datei, auf welche der Link Gästebuch
- ** lesen verweisen soll. (realtive Pfadangabe zum Script) **/
- /*************************************************/
-
- say 'Content-type: text/html'
- say ''
- parse arg args
- args = translate(args,' ','+')
- args = hex2str(args)
-
- say '<html><head><title>' owner'´s Gästebuch</title></head>'
- say '<body bgcolor="'hgfarbe'" text="'txtfarbe'" background="'hintergrundbild'" link="'linkfarbe'" vlink="'vlinkfarbe'">'
-
- parse var args 'name='name'&email='email'&hp='hp'&hptitel='hptitel'&kommentar='kommentar
- if kommentar='' then call leerkommentar(gbread,hr)
- kommentar = zeilenumbruch(kommentar)
- if name='' then name='Unbekannt'
- if hptitel='' then hptitel='Homepage'
- if hp = '' then hp = 'http://'
-
- if exists(datafile) then do
- dummy.0=7
- dummy.1=hr
- if email='' then dummy.2='<BR>'name
- else dummy.2 ='<BR>'name' <a href=mailto:'email'>('email')</a>'
- dummy.3 = 'schrieb am 'date()' um 'time()':<BR>'
- if hp ~= 'http://' then dummy.4 = '<a href='hp' target="_blank">'hptitel'</a><BR><BR>'
- else dummy.4 = ''
- dummy.5 = '<I>'kommentar'</I>'
- dummy.6 = '<BR>'
- dummy.7 = '<BR>'d2c(10)||d2c(10)
- call writelines(datafile,1,dummy,INSERT)
- say '<h1 align=center> Vielen Dank 'name' für den Eintrag in das Gästebuch von 'owner'!</h1>'
- say '<center>'
- say hr
- say '<BR><a href="'gbread'">Gästebuch lesen</A>'
- say '<br><BR>'
- say hr' 'copyright()
- say '</center>'
- say '</body></html>'
- end
- else do
- say '<h1 align=center>'hr'Eintrag konnte nicht aufgenommen werden! :-('hr'</h1>'
- say '<center>'
- say 'Der Webmaster ('owner') hat wohl das Gästebuchscript falsch oder garnicht konfiguriert!'
- say hr' 'copyright()
- say '</center>'
- say '</body></html>'
- end
- exit
-
- /** ******************************************* **/
- /** Prozeduren **/
- hex2str: procedure
- parse arg a
- b = '%'
- d = index(a,b)
- do while d ~= 0
- a = insert(x2c(substr(a,d+1,2)),delstr(a,d,3),d-1)
- d = index(a,b)
- end
- return a
-
- copyright: procedure
- return '<BR><a href="mailto:tba@gmx.li">© 2000, Martin Kayser</A><BR>'
-
- zeilenumbruch: procedure
- parse arg a
- b = d2c(13)
- d = index(a,b)
- do while d ~= 0
- a = insert('<BR>',delstr(a,d,1),d-1)
- d = index(a,b)
- end
- return a
-
- leerkommentar:
- parse arg gbread,hr
- say '<h1 align=center>'hr
- say '<BR>Eintrag wurde nicht aufgenommen! :-(<BR><BR>'
- say hr'</h1>'
- say '<center>'
- say '<BR>Grund: In das Kommentarfeld wurde nix eingetragen!<BR><BR>'
- say '<a href="'gbread'">Gästebuch lesen</A><BR><BR>'
- say hr' 'copyright()
- say '</center>'
- say '</body></html>'
- exit
-